import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
import Loading from '@/components/loading/loading.js' //Loading
// 引入echarts
import echarts from 'echarts'
import echartsGL from 'echarts-gl' // 引入echarts
import 'echarts-liquidfill/src/liquidFill.js'; //在这里引入
//使用百度地图
import BaiduMap from 'vue-baidu-map-v3'
//自动滚动
import scroll from 'vue-seamless-scroll'

Vue.prototype.$echarts = echarts
Vue.prototype.$echartsGL = echartsGL // 引入组件（将echarts注册为全局）
Vue.use(BaiduMap, {
    // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
    ak: 'gLWV67xpvVPwlwdRqg5BHqFmXVmFsB0h'
})

Vue.use(scroll)


router.beforeEach((to, from, next) => {
    const token = store.getters.getToken
    next()
});

Vue.use(ElementUI);
Vue.use(ElImageViewer);
Vue.use(Loading)
Vue.prototype.$axios = axios;
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
